package com.example.fengyungo.controller.admin;

import com.example.fengyungo.domain.entity.Order;
import com.example.fengyungo.domain.vo.OrderDetailsVO;
import com.example.fengyungo.result.Result;
import com.example.fengyungo.service.OrderService;
import com.example.fengyungo.util.RedisUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "风运Go管理端-订单管理")
@RestController
@RequestMapping("/admin/order")
public class AdminOrderController {

    @Autowired
    private OrderService orderService;

    @Autowired
    private RedisUtil redisUtil;

    @ApiOperation("条件查询订单信息")
    @GetMapping("/conditions")
    public Result<List<OrderDetailsVO>> getOrdersByCondition(Order order) {
        List<OrderDetailsVO> orderDetailsVOS = orderService.getOrderByCondition(order);
        return Result.success(orderDetailsVOS);
    }
}

